﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BattleShips.GameServers.CommandRunners;

namespace BattleShips.GameServers {
    class CommandRunnerRegistry {
        static Dictionary<string, ICommandRunner> runners = new Dictionary<string, ICommandRunner>() {
            {"login", new Login() },
            {"register", new Register() },
            {"createroom", new CreateRoom() },
            {"searchroom", new SearchForARoom() },
            {"searchplayer", new SearchForAPlayer() },
            {"selectfield", new SelectField() },
            {"exitgame", new ExitGame() },
            {"gooffline", new GoOffline() },
            {"hitfield", new HitField() },
            {"loginsuccessful", new LoginSuccessful() },
            {"surrender", new Surrender() }
        };

        public static ICommandRunner GetCommandRunner(string name) {
            return runners[name];
        }
    }
}
